<template>
  <!-- <div class="dog">
    <div class="content">
      <Dou />
      <div>这是一个孤独可怜的狗</div>
    </div>
    <div class="content">
      <Dou />
      <div>这是一个孤独可怜的狗</div>
    </div>
  </div> -->
  <!-- -------------------------↑孤独的狗 -->
  <div class="toto">
    <BuyDou
      v-for="(item, index) in arr"
      :key="index"
      :name="item.dogName"
      :img="item.dogImgUrl"
      :index="index"
      :item="item"
      @gg="tou"
    />
    <div class="like">
      <span>请选择要卖掉的狗:</span>
      <ul>
        <li v-for="(item, index) in newArr" :key="index">{{ item }}</li>
      </ul>
    </div>
  </div>
</template>

<script>
// import Dou from './components/Dou'
import BuyDou from './components/BuyDou'

export default {
  name: 'App',
  components: {
    // Dou,
    BuyDou,
  },
  data() {
    return {
      newArr: [],
      arr: [
        {
          dogImgUrl:
            'http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg',
          dogName: '博美',
        },
        {
          dogImgUrl:
            'https://img0.baidu.com/it/u=3294230058,3960964903&fm=253&fmt=auto&app=138&f=JPEG?w=606&h=500',
          dogName: '泰迪',
        },
        {
          dogImgUrl:
            'https://img0.baidu.com/it/u=2304869231,1961550872&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800',
          dogName: '金毛',
        },
        {
          dogImgUrl:
            'https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c',
          dogName: '哈士奇',
        },
        {
          dogImgUrl:
            'https://img0.baidu.com/it/u=605406382,1193722507&fm=253&fmt=auto&app=138&f=JPG?w=400&h=266',
          dogName: '阿拉斯加',
        },
        {
          dogImgUrl:
            'https://img2.baidu.com/it/u=3132539293,97293900&fm=253&fmt=auto&app=120&f=JPEG?w=635&h=583',
          dogName: '萨摩耶',
        },
      ],
    }
  },
  methods: {
    tou(index, item) {
      this.newArr.push(this.arr[index].dogName)
    },
  },
}
</script>

<style scoped>
/* .dog {
  display: flex;
}
.content {
  text-align: center;
  border: 1px solid #333;
  height: 225px;
} */
/* ------------------ */
.toto {
  display: flex;
  flex-wrap: wrap;

  /* background-color: rgb(240, 195, 203); */
}
</style>
